home *** CD-ROM | disk | FTP | other *** search
- /* File: mesh.h
- ** Author: Charles Loop
- ** Purpose: Defines data structures and constants needed to make a mesh.
- ** Last Modified: 2 July, 1987
- ** Reason : Creation.
- */
-
- /* Topology Types */
- #define MESH 1
- #define FACE 2
- #define SUBMESH 3
- #define TRIANGLE 4
- #define EDGE 5
- #define POINT 6
-
- /* Maximum Vertex order */
- #define maxN 16
-
- /* Other constants */
- #define TwoPi 6.28318530717958647692
- #define MIN 0
- #define MAX 1
-
- /* Mesh data structures */
-
- typedef struct Vertex {
- double x,y,z,a,b,c,k;
- } Vertex;
-
- typedef struct Plane {
- double a,b,c,d;
- short maxcomponent;
- } Plane;
-
- typedef struct Edge {
- PointType4D *p;
- struct Edge *e, *next;
- } Edge;
-
- typedef struct Triangle {
- Vertex *V[3];
- Plane *pl;
- } Triangle;
-
- typedef struct Mesh {
- short type;
- double box[3][2];
- double r;
- union {
- struct Mesh *m;
- Edge *e;
- Triangle *t;
- } sub;
- struct Mesh *next;
- } Mesh;
-
- /* Symbol Table data structures */
-
- typedef union Datum {
- double val;
- PointType4D *p;
- Edge *e;
- Mesh *m;
- } Datum;
-
- typedef struct SymbolEntry {
- char *name;
- Datum u;
- struct SymbolEntry *next;
- short type; /* POINT, FACE, MESH */
- } SymbolEntry;
-
- /* Edge Table data structures */
-
- typedef struct EdgeEntry {
- PointType4D *p,*q;
- Edge *e;
- struct EdgeEntry *next;
- } EdgeEntry;
-
-